﻿// Copyright (c) Microsoft Corporation.
// This sample code is provided "as is" without warranty of any kind. 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace FMInc.Transforms
{
    public static class EmbedUtil
    {
        public static string GetEmbeddedFileText(string fileName)
        {
            var resourceName = typeof(EmbedUtil).Namespace + "." + fileName;
            using (Stream stream = typeof(EmbedUtil).Assembly.GetManifestResourceStream(resourceName))
            {
                using (StreamReader reader = new StreamReader(stream))
                {
                    string contents = reader.ReadToEnd();
                    return contents;
                }
            }   
        }
    }
}
